package com.example.zhaohang.employmentapp;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

import com.example.zhaohang.utils.ToastMake;

public class ChoceOtherActivity extends AppCompatActivity implements View.OnClickListener {
    private ImageView mImage1;
    private ImageView mImage2;
    private ImageView mImage3;
    private Button    mName8;
    private ImageView mImagemian;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_choce_other);

        mImage1 = (ImageView) findViewById(R.id.image1);
        mImage2 = (ImageView) findViewById(R.id.image2);
        mImage3 = (ImageView) findViewById(R.id.image3);
        mImagemian = (ImageView) findViewById(R.id.imagemian);
        mName8 = (Button) findViewById(R.id.name8);

        mImage1.setOnClickListener(this);
        mImagemian.setOnClickListener(this);
        mImage2.setOnClickListener(this);
        mImage3.setOnClickListener(this);
        mName8.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.image1:
                MyApplayCation.postion = "2";
                mImage1.setImageDrawable(getResources().getDrawable(R.mipmap.select_qian));
                mImage2.setImageDrawable(getResources().getDrawable(R.mipmap.touminghou));
                mImage3.setImageDrawable(getResources().getDrawable(R.mipmap.touminghou));
                break;
            case R.id.image2:
                MyApplayCation.postion = "3";
                mImage2.setImageDrawable(getResources().getDrawable(R.mipmap.hou_left));
                mImage1.setImageDrawable(getResources().getDrawable(R.mipmap.seat));
                mImage3.setImageDrawable(getResources().getDrawable(R.mipmap.touminghou));
                break;
            case R.id.image3:
                MyApplayCation.postion = "4";
                mImage3.setImageDrawable(getResources().getDrawable(R.mipmap.hou_right));
                mImage1.setImageDrawable(getResources().getDrawable(R.mipmap.seat));
                mImage2.setImageDrawable(getResources().getDrawable(R.mipmap.touminghou));
                break;
            //开始扫码
            case R.id.name8:

                startActivity(new Intent(ChoceOtherActivity.this,SaoMaActivity.class));
                break;

            case R.id.imagemian:
                ToastMake.showToast("主驾无需扫码");
                break;
        }
    }
}
